package org.example.composite;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.HashMap;
import java.util.Map;


@SpringBootTest
public class Client {

    @Test
    void client(){
        //创建大学
        OrganizationComponent university=new University("清华大学","中国顶级大学");
        //创建大学的学院
        OrganizationComponent computerCollege=new College("计算机学院","计算机学院");
        OrganizationComponent infoEngineerCollege=new College("信息学院","信息学院");
        //创建大学的各个学院的专业
        computerCollege.add(new Department("软件工程","软件工程专业"));
        computerCollege.add(new Department("网络工程","网络工程专业"));
        computerCollege.add(new Department("计算机科学与技术","计算机科学与技术专业"));

        infoEngineerCollege.add(new Department("通信工程","通信工程专业"));
        infoEngineerCollege.add(new Department("信息工程","信息工程专业"));

        //将学院加入到学校中
        university.add(computerCollege);
        university.add(infoEngineerCollege);

        infoEngineerCollege.print();
    }

    @Test
    void test2(){
        Map<Integer, String> hashMap = new HashMap<>();
        hashMap.put(0,"东游记");
        Map<Integer, String> map = new HashMap<>();
        map.put(1,"西游记");
        map.put(2,"三国演义");
        map.putAll(hashMap);
        System.out.println(map.get(0));

    }
}
